package com.heima.apis.wemedia;

import com.heima.model.admin.admin.ChannelDto;
import com.heima.model.admin.dtos.NewsAuthDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.WmChannelDto;
import com.heima.model.wemedia.pojos.WmSensitive;
import com.heima.model.wemedia.pojos.WmUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@FeignClient("leadnews-wemedia")
public interface IWemediaClient {

    /**
     * 分页查询文章详情
     *
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/news/list_vo")
    public ResponseResult newListVo(@RequestBody NewsAuthDto dto);

    /**
     * 查询单个文章详情
     *
     * @param wmNewsId
     * @return
     */
    @GetMapping("/api/v1/news/one_vo/{id}")
    ResponseResult oneVoById(@PathVariable("id") Integer wmNewsId);

    /**
     * 成功审核
     *
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/news/auth_pass")
    ResponseResult authPass(@RequestBody NewsAuthDto dto);

    /**
     * 失败审核
     *
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/news/auth_fail")
    ResponseResult authFail(@RequestBody NewsAuthDto dto);

    //--------------------------------------------杨
    @PostMapping("/api/v1/login/wm_register")
    public ResponseResult wmRegister(@RequestBody WmUser wmUser);


    //--------------------------------------------徐
    //    删除敏感词
    @DeleteMapping("/api/v1/sensitive/del/{id}")
    ResponseResult DeleteSensitive(@PathVariable Integer id);

    //     新增敏感词
    @PostMapping("/api/v1/sensitive/save")
    ResponseResult Save(@RequestBody WmSensitive wmSensitive);

    //      更改敏感词
    @PostMapping("/api/v1/sensitive/update")
    ResponseResult Update(@RequestBody WmSensitive wmSensitive);

    //    查询敏感词
    @PostMapping("/api/v1/sensitive/list")
    ResponseResult SelectLike(@RequestBody Map map);

    /**
     * 查询所有敏感词
     */
    @GetMapping("/api/v1/sensitive/listAll")
    ResponseResult querySensitiveAll();
    //添加频道
    @PostMapping("/api/v1/channel/save")
    ResponseResult saveChannel(@RequestBody WmChannelDto wmChannel);

    //分页查询频道
    @PostMapping("/api/v1/channel/list")
    ResponseResult sybaseChannels(@RequestBody ChannelDto dto);

    //修改频道
    @PostMapping("/api/v1/channel/update")
    ResponseResult updateChannel(@RequestBody WmChannelDto wmChannel);

    //删除频道
    @GetMapping("/api/v1/channel/del/{id}")
    ResponseResult deleChannel(@PathVariable Integer id);
}
